﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.ZY
{
    class Class14
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {

            IPolicyPeriodActing dppa = ppa.PolicyActing.PeriodActings.FirstOrDefault(p => p.SchemePeriodActing.HolderStates.Contains("身故"));

            if (dppa != null && ppa.Period >= dppa.Period)
            {
                da.Value = ppa.Amount;
            }

        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.SchemePeriodActing.HolderAge < 60)
            {

                IPolicyPeriodActing dppa = ppa.PolicyActing.PeriodActings.FirstOrDefault(p => p.SchemePeriodActing.HolderStates.Contains("全残"));

                if (dppa != null && ppa.Period >= dppa.Period)
                {
                    da.Value = ppa.Amount;
                }
            }

        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {



            IPolicyPeriodActing dppa = ppa.PolicyActing.PeriodActings.FirstOrDefault(p => p.SchemePeriodActing.HolderStates.Contains("重疾"));

            if (dppa != null && ppa.Period >= dppa.Period)
            {
                da.Value = ppa.Amount;
            }


        }
    }
}
